using System;
using System.Runtime.InteropServices;

namespace Exchange.Export.MAPIMessageConverter
{
	#region IConverterSession
//	/// <summary>
//	/// Allows conversions between MIME objects and MAPI messages. 
//	/// This can be useful in transporting messages across the Internet.
//	/// mapidefs.h, mimeole.h, mapimime.h
//	/// </summary>
//	[Guid("4b401570-b77b-11d0-9da5-00c04fd65685"),
//	InterfaceType(ComInterfaceType.InterfaceIsDual)] 
//	public interface IConverterSession
//	{
//		//HRESULT IConverterSession:: SetEncoding (ENCODINGTYPE et);
//		void SetEncoding(
//			[In] ENCODINGTYPE et);
//		//HRESULT IConverterSession:: MIMEToMAPI (LPSTREAM pstm, LPMESSAGE pmsg, LPCSTR pszSrcSrv, ULONG ulFlags);
//		void MIMEToMAPI(
//			[In] IStream pstm,
//			[Out] IMessage pmsg,
//			[In] string pszSrcSrv,
//			[In] MIMETOMAPIFLAGS ulFlags);
//		//HRESULT IConverterSession::MAPIToMIMEStm(LPMESSAGE pmsg, LPSTREAM pstm, ULONG ulFlags);
//		void MAPIToMIMEStm(
//			[In] IMessage pmsg,
//			[Out] IStream pstm,
//			[In] MAPITOMINEFLAGS ulFlags);
//		//HRESULT IConverterSession::SetTextWrapping (BOOL fWrapText, ULONG   ulWrapWidth);
//		void SetTextWrapping(
//			[In] int fWrapText,
//			[In] int ulWrapWidth);
//		//HRESULT IConverterSession::SetSaveFormat (MIMESAVETYPE mstSaveFormat);
//		void SetSaveFormat(
//			[In] MIMESAVETYPE mstSaveFormat);
//	}

	#endregion

	#region IConverterSession Flags
	public enum MIMESAVETYPE
	{
		/// <summary>
		/// Uuencoded
		/// </summary>
		SAVE_RFC822 = 0,
		/// <summary>
		/// Mime
		/// </summary>
		SAVE_RFC1521 = SAVE_RFC822 + 1
	}

	public enum ENCODINGTYPE
	{
		IET_BASE64 = 1,
		IET_UUENCODE = 2,
		IET_QP = 3,
		IET_7BIT =  4,
		IET_8BIT = 5
	}

	[Flags]
	public enum MAPITOMINEFLAGS
	{
		/// <summary>
		/// The converter is being passed an SMTP message. This flag must always be set.
		/// </summary>
		CCSF_SMTP  = 0x0002,
		/// <summary>
		/// The converter should ignore the headers of the outside message. 
		/// </summary>
		CCSF_NOHEADERS  = 0x0004,
		/// <summary>
		/// Do not include Message-Id field in outgoing messages.
		/// </summary>
		CCSF_NO_MSGID  = 0x4000
	}
	
	[Flags]
	public enum MIMETOMAPIFLAGS
	{
		CCSF_NONE = 0,
		/// <summary>
		/// The MIME stream is for an SMTP message.
		/// </summary>
		CCSF_SMTP  = 0x0002,
		/// <summary>
		/// BCC recipients of the MIME stream should be included in the MAPI message.
		/// </summary>
		CCSF_INCLUDE_BCC = 0x0020,
		/// <summary>
		/// The HTML body of the MIME stream should be converted to RTF in the MAPI message.
		/// </summary>
		CCSF_USE_RTF = 0x0080 
	}
	#endregion
}
